{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>详情</h5>
                </div>
                <div class="ibox-content layui-form">
                    <div class="layui-row layui-col-space10 layui-form-item ">

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">昵称：</label>
                            <div class="layui-input-block">
                                <input type="text" name="user_username" lay-verify="required" placeholder="昵称"  value="{$info.user_username}" class="layui-input ">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">登录手机号：</label>
                            <div class="layui-input-block">
                                <input type="text" name="user_phone" lay-verify="required" placeholder="登录手机号"  value="{$info.user_phone}" class="layui-input ">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">登录密码：</label>
                            <div class="layui-input-block">
                                <input type="password" name="user_password" placeholder="更改密码时填写，不更改密码不要填写"  value="" class="layui-input ">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">头像：</label>
                            <input type="hidden" name="user_image" id="lay-img" lay-verify="image" value="{$info.user_image}">
                            <div class="layui-input-block">
                                <div id="lay-upload">上传图片</div>
                                <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
                                    预览图：
                                    <div class="layui-upload-list" id="lay-list">
                                        <img class="layui-append-img" src="{$info.user_image}" onerror="this.src='/static/admin/images/no_img.jpg'">
                                    </div>
                                </blockquote>
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">性别：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="user_gender" value="1" title="男" {if $info.user_gender==1}checked{/if}>
                                <input type="radio" name="user_gender" value="2" title="女" {if $info.user_gender==2}checked{/if}>
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">生日：</label>
                            <div class="layui-input-block">
                                <input type="text" onfocus="wk.lay_date_ymd(this);" name="user_birthday" readonly  value="{$info.user_birthday}" class="layui-input layer-date">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">个性签名：</label>
                            <div class="layui-input-block">
                                <textarea lay-verify="required" name="user_sign" class="layui-input " style="height:80px">{$info.user_sign}</textarea>
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8" id="goods_id">
                            <label class="layui-form-label">喜爱的乐器：</label>
                            <div class="layui-input-block">
                                <select name="user_like_axe" xm-select="select1" xm-select-search="" xm-select-search-type="dl">
                                    <option value="">请选择</option>
                                    {foreach name="axe" item="v"}
                                    <option value="{$v.axe_id}" {if in_array($v.axe_id,$info['user_like_axe'])} selected {/if}>
                                        {$v.axe_name}
                                    </option>
                                    {/foreach}
                                </select>
                                {if $info.user_other_axe}
                                <input type="text" name="user_other_axe" lay-verify="required" placeholder="其他乐器"  value="其他：{$info.user_other_axe}" class="layui-input ">
                                {/if}
                            </div>
                        </div>
                        <!--xm-select-radio=""-->
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">所属琴行：</label>
                            <div class="layui-input-block">
                                <select name="user_piano" {if $info['user_type']==1}xm-select-radio=""{/if} xm-select="select2" xm-select-search="" xm-select-search-type="dl">
                                    <option value="">请选择</option>
                                    {foreach name="panio" item="v"}
                                    <option value="{$v.pa_id}" {if in_array($v.pa_id,$info['user_piano'])} selected {/if}>
                                        {$v.pa_name}
                                    </option>
                                    {/foreach}
                                </select>
                            </div>
                        </div>
                        <input type="hidden" value="{$user_id}" name="user_id">
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="component-form-element">保存
                                </button>
                                <button class="layui-btn layui-btn-primary" onclick="wk.layer_close('close')">关闭</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    var editor = wk.wang({elem:'#LAY_editor'});
    wk.uploadImg({size:5,type:'png,jpg,jpeg',url:"{:url('Upload/upload')}",domain:""});
    layui.use(['form','upload','layedit'], function() {
        var form = layui.form;
//        form.verify({
//            editor:function(value,item){
//                if(editor.txt.html() == '<p><br></p>'){
//                    return '请填写内容';
//                }
//            }
//        });
        form.on('submit(component-form-element)', function (data) {
            data.field.banner_content = editor.txt.html();
            $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"{:url('memberEdit')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    if (res.code == 200) {
                        layer.msg(res.msg,{icon:1,time:1500,shade:0.1},function(index){
                            wk.layer_close();
                        })
                    } else {
                        wk.error(res.msg,'','$(".layui-btn").removeClass(\'layui-disabled\').removeAttr(\'disabled\');');
                    }
                }
            })
        });
    });
</script>

</body>
</html>
